#include"kmeans.cpp"

void evaluatePerformance(const std::vector<Point>& data, int k, int maxIterations) {
    std::vector<int> thread_counts = {1, 2, 4, 8, 12}; // Adjust the number of threads as needed

    for (int threads : thread_counts) {
        omp_set_num_threads(threads);
        std::vector<Point> data_copy = data;

        double startTime = omp_get_wtime();
        kmeans(data_copy, k, maxIterations, true);
        double endTime = omp_get_wtime();

        double duration = endTime - startTime;
        std::cout << "Parallel K-means clustering with " << threads << " threads took " << duration << " seconds\n";
    }
}
int main() {
    std::string filename = "Asia towers.csv"; // Update with the actual path
    std::vector<Point> data = readData(filename);
    int k = 5; // Number of clusters
    int maxIterations = 100;


    // Serial k-means
    std::vector<Point> data_serial = data;
    double startTime = omp_get_wtime();
    kmeans(data_serial, k, maxIterations, false);
    double endTime = omp_get_wtime();
    double serialTime = endTime - startTime;
    std::cout << "Serial K-means clustering took " << serialTime << " seconds\n";

    // Parallel k-means with different number of threads
    evaluatePerformance(data, k, maxIterations);
    return 0;
}